﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MishraReader.ViewModels.AppServices;

namespace MishraReader.PlatformVMs
{
    class UrlLauncher : IUrlLauncher
    {
        public void LaunchUri(Uri location)
        {
            if (location == null) 
                throw new ArgumentNullException("location");
            
            // ensure it's either http/s or mailto
            var scheme = location.Scheme.ToUpperInvariant();
            if (scheme == "HTTP" ||
                scheme == "HTTPS" ||
                scheme == "MAILTO")
            {
                var str = location.ToString();

                Process.Start(str);
            }
        }
    }
}
